Function: getAttribute(domElementOrCSSSelector, stringAttributeName) Shorthand: getAttr(domElementOrCSSSelector, stringAttributeName) Description: Returns the specified attribute value for a DOM element, markup string, or CSS selector referenced element. Returns: Attribute Value. Note: The getAttribute() function always returns an attribute value or null if undefined, even when chained. Example: // Get an attribute on a DOM element var tabIndex = $A.getAttribute(domElement, "tabindex"); // Get an attribute on a DOM element referenced by a CSS selector var listboxValue = $A.getAttribute('#myListbox *[role="option"][aria-selected="true"]', "data-value"); // Or the same using chaining // Get an attribute on a DOM element var tabIndex = $A(domElement).getAttribute("tabindex"); // Get an attribute on a DOM element referenced by a CSS selector var listboxValue = $A('#myListbox *[role="option"][aria-selected="true"]').getAttribute("data-value");